<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        var name = "iwen";
        var user = {
            name,
            age: 20,
            /* getName:function(){
                 console.log(this.name);
             }, */
            getName() {
                console.log(this.name);
            }

        }

        user.getName();

        function getpoint() {
            var x = 10.23;
            var y = 23.34;
            return { x, y }
        }

        console.log(getpoint().x, getpoint().y);

        //ES6 允许字面量定义对象时，用表达式作为对象的属性名，即把表达式放在方括号内
        let propKey = 'itbaizhan';


        let obj = {
            [propKey]: true,
            ['a' + 'bc']: 123
        };

    </script>
</body>

</html>